Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Solution #296

wants to merge 1 commit into from

Conversation

YuliiaDov
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Your code is well-structured and meets the task requirements effectively! 🎉 While there are some areas for improvement, such as ensuring the correct implementation of assertions and verifying the necessity of database clearing before each test, these are minor and do not critically impact the functionality. Keep up the great work, and consider the feedback for future enhancements! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

});

beforeEach(() => {
cy.task("db:clear");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cy.task('db:clear') command is used to clear the database before each test. Ensure that this task is correctly defined in your Cypress support files and that it performs the intended database clearing operation. If not all tests require a fresh database state, consider moving this to specific tests that need it.

beforeEach(() => {
cy.task("db:clear");
cy.visit("/");
cy.registerAndLogin(user.email, user.username, user.password);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cy.registerAndLogin function is called before each test. Ensure that this function is correctly defined and that it performs the registration and login operations as expected. If not all tests require a user to be registered and logged in, consider moving this to specific tests that need it.

Comment on lines +46 to +51
cy.createArticle(
article.title,
article.description,
article.body,
article.tag
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cy.createArticle function is used to create an article before editing and deleting tests. Ensure that this function is correctly defined and that it performs the article creation operation as expected. This setup is necessary for the edit and delete tests, so it should be verified for correctness.

});

beforeEach(() => {
cy.task("db:clear");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cy.task('db:clear') command is used to clear the database before each test. Ensure that this task is correctly defined in your Cypress support files and that it performs the intended database clearing operation. If not all tests require a fresh database state, consider moving this to specific tests that need it.

beforeEach(() => {
cy.task("db:clear");
cy.visit("/#/register");
cy.registerAndLogin(user.email, user.username, user.password);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cy.registerAndLogin function is called before each test. Ensure that this function is correctly defined and that it performs the registration and login operations as expected. If not all tests require a user to be registered and logged in, consider moving this to specific tests that need it.

}

typeTag(tag) {
this.tagField.first().type(tag);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typeTag method uses .first() to select the first tag field. Ensure that this is the intended behavior and that the application supports multiple tag fields if necessary.

}

clickEditArticleBtn() {
this.editArticleBtn.first().click();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clickEditArticleBtn method uses .first() to select the first edit button. Ensure that this is the intended behavior and that the application supports multiple edit buttons if necessary.

}

clickDeleteArticleBtn() {
this.deleteArticleBtn.first().click();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clickDeleteArticleBtn method uses .first() to select the first delete button. Ensure that this is the intended behavior and that the application supports multiple delete buttons if necessary.

}

typeBio(bio) {
this.bioField.type(bio);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typeBio method does not clear the bio field before typing. If the intention is to replace the existing bio, consider using clear().type(bio) to ensure the field is cleared before typing.

}

get followBtn() {
return cy.getByDataCy('follow-unfollow-btn');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The followBtn and unfollowBtn getters both use the same data-cy attribute ('follow-unfollow-btn'). Ensure that the application logic correctly distinguishes between the follow and unfollow states, possibly by checking the button text or another attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants